<template>
    <div id="app">
      <el-form ref="DisSaleChance" :model="saleChance" label-width="100px">
        <el-form-item label="销售人员">
          <el-select v-model="saleChance.saleman" placeholder="请选择">
            <el-option
              v-for="item in salemenList"
              :key="item.id"
              :label="item.name"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="DisSaleChance()">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          saleChance:{},
          salemenList:[]
        }
      },
      created(){
        this.axios.get("/emp/selectSaleman").then((resp)=>{
          this.salemenList=resp.data;
        });
        this.saleChance.id=this.$route.query.cid
      },
      methods:{
        DisSaleChance(){
          //发出ajax请求
          this.axios.put("/saleChance/updateStateById",this.saleChance).then((resp)=>{
            this.$router.push("/saleChance/SaleChanceList");
          })
        }
      }
    }
</script>


<style scoped>

</style>
